<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Coil/indexdel')}">列表</a></li>

    </ul>
    <form class=" well form-inline margin-top-20" method="get" id="ljz-form-search">
        姓名:
        <input type="text" class="form-control" name="key_name" style="width:150px;"
               value="" placeholder="">



        <button class="btn btn-primary" id="bt_search">搜索</button>
        <button class="btn btn-primary" id="bt_output">导出</button>

        <a class="btn btn-danger" href="{:url('Coil/indexdel')}">清空</a>

    </form>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th>捆包号</th>
            <th>采购合同号</th>
            <th>钢卷号</th>
            <th>原料钢种</th>
            <th>厚</th>
            <th>宽</th>
            <th>长</th>
            <th>重量(吨)</th>
            <th>采购单价</th>
            <th>库位</th>
            <th>被占重量</th>
            <th>入库时间</th>
            <th>成品品名</th>
            <th>归属类型</th>
            <th>产权归属</th>
            <th>客户名称</th>
            <th>所属钢厂</th>
            <th>添加时间</th>
            <th>更新时间</th>
            <th>出库时间</th>
            <th>最后操作人</th>

        </tr>
        </thead>
        <tbody>
        <foreach name="lists['data']" item="vo">
            <tr>
                <td>
                    {$vo['name']}
                </td>
                <td>
                    {$vo['po_name']}
                </td>
                <td>
                    {$vo['coilno']}
                </td>

                <td>
                    {$grade_id_arr[$vo['steel_grade_id']]|default=''}
                </td>
                <td>
                    {$vo['d']}
                </td>
                <td>
                    {$vo['w']}
                </td>
                <td>
                    {$vo['h']}
                </td>
                <td>
                    {$vo['weight']}
                </td>
                <td>
                    {$vo['po_price']}
                </td>
                <td>
                    {$vo['locator']}
                </td>
                <td>
                    {$vo['occupied_we']}
                </td>
                <td>
                    {:date('Y-m-d H:i',$vo['loadingtime'])}
                </td>
                <td>
                    {$vo['product']}
                </td>
                <td>{$companytypea_arr[$vo['companytype']]|default=''}</td>
                <td>
                    <if condition="$vo['property_id']!=0" >
                        {$company_id_arr[$vo['property_id']]['abb_name']|default=$company_id_arr[$vo['property_id']]['name']}
                        <else/>
                        华星科技
                    </if>

                </td>
                <td>
                    <php>$vo['company_id']=explode(',',  $vo['company_id']);</php>
                    <foreach name="vo['company_id']" item="vo1">
                        <if condition="$vo1!=0" >
                            {$company_id_arr[$vo1]['abb_name']|default=$company_id_arr[$vo1]['name']},

                        </if>
                    </foreach>

                </td>
                <td>
                    <if condition="$vo['steel_mill']!=0" >
                        {$company_id_arr[$vo['steel_mill']]['abb_name']|default=$company_id_arr[$vo['steel_mill']]['name']}
                    </if>

                </td>

                <td>
                    {:date('Y-m-d H:i',$vo['add_time'])}
                </td>
                <td>
                    {:date('Y-m-d H:i',$vo['update_time'])}
                </td>
                <td>
                    {:date('Y-m-d H:i',$vo['delete_time'])}
                </td>
                <td>
                    {$user_arr[$vo['admin_id']]|default=''}
                </td>

            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script src="/static/js/admin.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script>
    function see(obj) {
        layer.open({
            content: $(obj).text().trim()
        });
    }

    $(function () {
        // 条件查询
        $("#bt_search").click(function(){
            $("#ljz-form-search").removeAttr('action');
            $("#ljz-form-search").attr('action',"{:url('Coil/indexdel')}" );
            $("#ljz-form-search").submit();
        });
        // 数据导出成excel表格
        $("#bt_output").click(function(){
            $("#ljz-form-search").removeAttr('action');
            $("#ljz-form-search").attr('action',"{:url('Coil/outexceldel')}");
            $("#ljz-form-search").submit();
        });
    });
    function detail(id, field) {
        $.ajax({
            url: '{:url('Coil / field
        ')}?id=' + id + '&field=' + field,
            type
    :
        'get',
            success(res)
        {
            if (res.code == 1) {
                let tpl = '';
                for (const item of res.data) {
                    tpl += `<p>地址：<input value="${item}" readonly class="form-control" style="width:80%;display: inline-block;" type="text">&nbsp;<a target="_blank" href="{$domain}${item}" class="btn btn-success">跳转</a></p>`;
                }
                layer.open({
                    area: ['60%', '100%'],
                    content: tpl
                });
            } else {
                layer.msg('查看失败');
            }
        }
    })
        ;
    }
</script>
</body>
</html>
</body>
</html>
